package me.ZFC.Text;

public class Test20 {
    public static void main(String[] args) {
        int[] arr={1,2,3};
        String str=toString(arr);
        System.out.println(str);
    }
    public static String toString(int[] arr){
        if(arr==null){
            return null;
        }
        StringBuilder sb=new StringBuilder();
        sb.append('[');
        for (int i = 0; i < arr.length; i++) {
            sb.append(arr[i]);
            if(i!=arr.length-1){
                sb.append(',');
            }
        }
        sb.append(']');
        return sb.toString();
    }
}
